<template>
    <overallview :element="props.element">
        <el-form-item 
            :label-width="props.element.options.labelHide ? '0px' : props.element.options.labelWidth.value ?  props.element.options.labelWidth.value + props.element.options.labelWidth.unit :  ''"
        >
            <template #label>
                <span class="fc-form-title">
                    <el-tooltip v-if="props.element.options.prompt"  :content="props.element.options.prompt">      
                        <my-icon  name="el-icon-Warning" size="14" style="top: 2px;"/>
                    </el-tooltip>
                    {{ props.element.options.label }}
                </span>
            </template>
            <el-radio-group 
                v-model="props.element.options.value"
                :ref="props.element.options.ref ? props.element.options.ref : undefined"
                :id="props.element.options.id ? props.element.options.id : undefined"
                :name="props.element.options.name ? props.element.options.name : undefined"
                :fill="props.element.options.fill ? props.element.options.fill : undefined"
                :text-color="props.element.options.textcolor ? props.element.options.textcolor : undefined"
                :disabled="props.element.options.disabled"
            >
                <template v-for="(item, index) in props.element.options.options.data" :key="index">
                    <el-radio v-if="!props.element.options.isbutton" :label="item.label" :value="item.value" :disabled="item.disabled" />
                    <el-radio-button  v-else :label="item.label" :value="item.value"  :disabled="item.disabled"/>
                </template>                
            </el-radio-group>
        </el-form-item>
    </overallview>
</template>

<script setup>
import overallview from '../overallview.vue'
// 接收父节传入点参数
const props = defineProps({
    element: { // 元素信息
        type: Object,
        default: () => ({}),
    }
})
</script>